package com.xiaoqi.api.config;

import com.xiaoqi.api.properties.OSSProperties;
import com.xiaoqi.api.utlis.AliYunOSSUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class AliYunOSSConfig {
    @Bean
    public AliYunOSSUtil createAliYunOSSUtil(OSSProperties ossProperties){

        AliYunOSSUtil aliYunOSSUtil = new AliYunOSSUtil(ossProperties.getEndpoint(),ossProperties.getAccessKeyId(),ossProperties.getAccessKeySecret(),ossProperties.getBucketName());
        return aliYunOSSUtil;
    }
}
